#include "FastLED.h"     // 此示例程序需要使用FastLED库
#define NUM_LEDS 16      // 灯珠的数量，由于扩展板只有16个灯 所以定义为16         
#define DATA_PIN 5       // 引脚号 这里可以查阅规范白皮书       
#define LED_TYPE WS2812  // 灯珠的类型       
#define COLOR_ORDER RBG        
uint8_t max_bright = 5;  // WS2812灯珠的亮度 范围是0~255 可以适当调节       
CRGB leds[NUM_LEDS];         
void setup() { 
  LEDS.addLeds<LED_TYPE,DATA_PIN,COLOR_ORDER>(leds,NUM_LEDS);   // 初始化光带 
  FastLED.setBrightness(max_bright);                            // 设置光带亮度
}
//"*** "  "*   "  "****"  "****"  "*  *"  "****"  
//"* * "  "*   "  "  * "  "  * "  "*  *"  "  * "  
//"* * "  "*   "  " *  "  "   *"  "****"  "   *"  
//"*** "  "*   "  "****"  "****"  "   *"  "****"   

//"  * "  "****"  "****"  "****"  这是能够打印出来的图像
//" ** "  "   *"  "****"  "****"  下面的数组每行对应一个数字
//"*  *"  "   *"  "*  *"  "   *"  可以查阅规范白皮书查看灯珠之间的连接顺序
//" ** "  "   *"  "****"  "****"  根据顺序进行改动 
char sz[][16]={{0,1,1,1,1,0,1,0,0,1,0,1,1,1,1,0},
               {0,0,0,1,1,0,0,0,0,0,0,1,1,0,0,0},
               {1,1,1,1,0,1,0,0,0,1,0,0,1,1,1,1},
               {1,1,1,1,0,0,0,1,0,1,0,0,1,1,1,1},
               {1,0,0,0,1,1,1,1,1,0,0,1,1,0,0,1},
               {1,1,1,1,0,0,1,0,0,0,1,0,1,1,1,1},
               {0,1,1,0,1,0,0,1,0,1,1,0,0,0,1,0},
               {1,0,0,0,0,0,0,1,1,0,0,0,1,1,1,1},
               {1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1},
               {1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1}};
int count=0;
int times=0;
void loop() {
    for(int i=0;i<16;i++)
    {
      
      if(sz[count][i]==0)
      {
        leds[i].r=0x0;
        leds[i].g=0x0;
        leds[i].b=0x0;
      }
      else
      {
          leds[i].r=0xFF;
          leds[i].g=0xFF;
          leds[i].b=0xFF;
      }
    }
  FastLED.show();               // 更新LED色彩
  delay(1000);                   // 等待100毫秒
  times++;
  if(times>=8)
  {
    count++;
    times=0;
  }
  if(count>=10) count%=10;
}
